package com.xc.quickstart.service.impl;


import com.xc.quickstart.common.constant.RedisKeyConstant;
import com.xc.quickstart.infrastructure.redis.RedisService;
import com.xc.quickstart.service.AuthorityBizService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 提供数据权限相关服务
 * </p>
 *
 * @author chaoyu
 * @date 2021-02-23
 */
@Service
@Slf4j
public class AuthorityBizServiceImpl implements AuthorityBizService {

    @Autowired
    private RedisService redisService;

    @Override
    public void clear(Integer xcmchid, String jobNumber) {
        redisService.del(String.format(RedisKeyConstant.AUTHORITY_PERMISSION_KEY, jobNumber, 0, xcmchid));
        redisService.del(String.format(RedisKeyConstant.AUTHORITY_DEPT_INFO_KEY, jobNumber, xcmchid));
        redisService.del(String.format(RedisKeyConstant.AUTHORITY_CODE_KEY, jobNumber));
    }

}
